﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace Circus.CodeEditor {

    /// <summary>
    /// 表示编辑器的默认配置。
    /// </summary>
    internal static class Configs {

        #region 渲染

        #region 边界

        /// <summary>
        /// 默认边界区域宽度。
        /// </summary>
        public const int defaultGutterWidth = 64;
        public const uint defaultGutterForeColor = 0x8F8F8F;
        public const uint defaultGutterBackColor = 0xE9E9E9;
        
        /// <summary>
        /// 默认书签区域的宽度。
        /// </summary>
        public const int defaultBookmarksWidth = 20;
        public const int defaultLineNumbersWidth = 30;
        public const int defaultLineNumbersStart = 1;

        /// <summary>
        /// 折叠标记的宽度。
        /// </summary>
        public const int defaultFoldMarkerWidth = 4;

        /// <summary>
        /// 折叠标记两边的外间距。
        /// </summary>
        public const int foldMarkerMargin = 2;

        /// <summary>
        /// 折叠标记两边的内间距。
        /// </summary>
        public const int foldMarkerPadding = 2;

        #endregion

        #region 文档

        public const int initialVisualLineCount = 100;
        public const int defaultTabWidth = 4;

        /// <summary>
        /// 自动换行后新行是否自动继承上行的缩进。
        /// </summary>
        public const bool defaultInheritIndents = true;

        /// <summary>
        /// 当自动换行后新行的缩进空格数。
        /// </summary>
        public const int defaultWrapIndentCount = 2;

        public const int defaultBackColor = 0xF0F0F0;
        public const int defaultForeColor = 0x454545;

        public const int documentPaddingLeft = 2;
        public const int documentPaddingRight = 2;
        public const int autoBreakMarkWidth = 10;

        public const string defaultFontName = "Yahei Consolas Hybrid";
        public const float defaultFontSize = 30;

        public const int defaultVScrollBarSize = 21;
        public const int defaultHScrollBarSize = 21;


        public const RichTextBoxScrollBars defaultScrollBars = RichTextBoxScrollBars.ForcedBoth;

        /// <summary>
        /// 默认是否自动换行。
        /// </summary>
        public const bool defaultWordWrap = false;

        public const int defaultWidth = 800;
        public const int defaultHeight = 600;

        #endregion

        #endregion

        #region 编辑

        public static uint defaultSelectionBackColor = Painter.toRGB(Color.FromArgb(173, 214, 255));

        public static uint defaultInactivedSelectionBackColor = Painter.toRGB(SystemColors.InactiveCaption);

        /// <summary>
        /// 光标宽度。
        /// </summary>
        public const int caretWidth = 2;

        public const DocumentLineFlags newLineType = DocumentLineFlags.newLineTypeWin;

        #endregion

    }

}
